package com.atguigu.lease.common.exception;

import com.atguigu.lease.common.result.ResultCodeEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author Ruchan
 * @title LeaseException
 * @date 2024/11/2 08:51
 * @description 
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ToString
public class LeaseException extends RuntimeException{
    private Integer code;

    public LeaseException(Integer code,String message){
        super(message);
        this.code = code;
    }

    public LeaseException(ResultCodeEnum resultCodeEnum){
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }


}
